Repository navigation
Pass Mago 1.59 format, lint and analyze checks - #245
Merged
Merged
Conversation
CI installs the latest Mago release, and 1.59.0 fails 0.6.x: one file needs reformatting and analyze reports ten errors that the baseline no longer matches. Pdo\Statement now reads its PDOStatement through a private getPreparedResource() guard instead of calling execute(), errorInfo() and bindParam() on a resource typed PDOStatement|false|null. An unprepared resource throws the new Adapter\Exception\RuntimeException::forUnpreparedStatement() rather than failing on a call to null or false. AbstractPlatform::getTypeDecorator() types its loop variable as PlatformDecoratorInterface. The property keeps its plain array type because Platform stores nested arrays in it. The six AbstractRowGateway findings are baselined, since php-db#233 rewrites that class for Mago compliance. Both baselines are regenerated under 1.59.0, which also drops the entries that no longer match.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
tyrsson
approved these changes
Nov 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
0.6.xhas failed the Mago and mutation-test jobs since the merge of #234 on 27 Oct. The code didn't change: CI installs the latest Mago, which is now 1.59.0. Under 1.57 the branch is clean. Under 1.59:mago format --checkwantsUpdate::processSet()reformatted.mago analyzereports 10 errors inPdo\Statement,AbstractPlatformandAbstractRowGateway. The Statement and platform findings were already baselined, but 1.59 reworded their messages so the baseline stopped matching.Mutation testing fails at the same point, because Infection runs
mago analyzebefore mutating. Any PR that updates against0.6.x(for example #235) inherits all of this.Fix
Pdo\Statement:execute()andbindParametersFromContainer()read the PDO statement through a new privategetPreparedResource(): PDOStatementguard instead of callingexecute(),errorInfo()andbindParam()onPDOStatement|false|null. An unprepared resource throws the newAdapter\Exception\RuntimeException::forUnpreparedStatement()instead of failing on a call tonullorfalse. Two tests cover the guard, one throughexecute()and one through parameter binding.AbstractPlatform::getTypeDecorator(): the loop variable is typedPlatformDecoratorInterfaceinline. The$decoratorsproperty keeps its plainarraytype becausePlatformstores nested arrays in it.AbstractRowGateway: its sixmixed-array-indexfindings are baselined rather than fixed, because Bring TableGateway and RowGateway to Mago compliance #233 rewrites that class for Mago compliance and a fix here would only conflict with it.Update.php: reformatted.Checks (local, Mago 1.59.0)
mago format --check,lint,analyzeandguardpass for PHP 8.3, 8.4 and 8.5.Update.phpcode this PR doesn't change.The regenerated baseline drops entries worded the 1.57 way, so this belongs with php-db/phpdb-qa-tools#8, which pins CI to Mago 1.59.0. They can merge in either order because CI already installs 1.59.0.